import request from '@/utils/request'

/**
 * 材料列表
 * @param {*} query 
 * @returns 
 */
export function StoreKeeping(query) {
    return request({
        url: '/drill/material/list',
        method: 'get',
        params: query
    })
}

/**
 * 材料新增
 * @param {materialName,materialCategory,attachId,duration,brief} data 
 * @returns 
 */
export function MaterialNew(data) {
    return request({
        url: '/drill/material',
        method: 'post',
        data: data
    })
}

/**
 * 材料详情
 * @param {materialId} materialId 
 * @returns 
 */
export function MaterialDetails(materialId) {
    return request({
        url: '/drill/material/' + materialId,
        method: 'get',
    })
}

/**
 * 材料删除
 * @param {materialId} materialId 
 * @returns 
 */
export function MaterialDelete(materialId) {
    return request({
        url: '/drill/material/' + materialId,
        method: 'delete',
    })
}

/**
 * 材料附件查询
 * @param {attachIds} attachIds 
 * @returns 
 */
export function AttachIds(attachIds) {
    return request({
        url: '/com/ComAttach/selectManyAttach',
        method: 'post',
        data: attachIds
    })
}

/**
 * 材料修改
 * @param {*} data 
 * @returns 
 */
export function Amend(data) {
    return request({
        url: '/drill/material',
        method: 'put',
        data: data
    })
}